class Volunteer < ActiveRecord::Base
  has_and_belongs_to_many :activities
  validates_presence_of    :name   ,:message => "  真实姓名不能为空"
  validates_presence_of    :gender  ,:message => "  性别不能为空"
  validates_inclusion_of :gender, :in => %w( 男 女 ) ,:message => "  性别为男或者女"
  validates_presence_of    :identification ,:message => "  身份证号码不能为空"
  validates_length_of :identification, :is => 18, :message => "  身份证号码长度为18位"
end
